<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/9/19 0019
 * Time: 下午 2:54
 */
namespace app\admin\controller;
use app\member\controller\Api;
use app\member\controller\Member;
use app\message\controller\Message;
use think\Db;

class Index extends Base{
    #用户主页
    public function index(){
        #留言列表
        $ms = new Message();
        $mes = $ms ->mes_list();

        $this->assign([
            'mes'=>$mes['data']['list'],
            'pages'=>$mes['data']['page'],
            'curr'=>$mes['data']['curr']
        ]);
        return $this->fetch('./public/user/home.html');
    }
    #发表留言页面
    public function mes_index(){
        return $this->fetch('./public/user/index.html');
    }
    #用户中心
    public function info(){
        $admin_info = session('admin_info');

        #个人信息
        $info = Db::name('member')->where(['id'=>$admin_info['id']])->find();
        $this->assign('info',$info);

        #留言管理
        $ms = new Message();
        $mes = $ms ->mes_list_info();

        $this->assign(['mes'=>$mes['data']['list'],'pages'=>$mes['data']['page'],'curr'=>$mes['data']['curr']]);

        return $this->fetch('./public/user/info.html');
    }
}